package com.tarena.security.admin.persistis.repository;

import com.tarena.security.admin.dao.DepartmentMapper;
import com.tarena.security.admin.entity.db.Department;
import com.tarena.security.admin.entity.query.DepartmentQuery;
import com.tarena.security.admin.persists.repository.DepartmentRepository;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Ly
 * @since 2023-04-10
 */
@Repository
public class DepartmentRepositoryImpl implements DepartmentRepository {

    @Resource
    private DepartmentMapper departmentMapper;

    @Override public int addNewDepartment(Department department) {
        return departmentMapper.addNewDepartment(department);
    }

    @Override public int getDepartmentCountByName(String name) {
        return departmentMapper.getDepartmentCountByName(name);
    }

    @Override public List<Department> getDepartmentList(DepartmentQuery query) {
        return departmentMapper.getDepartmentList(query);
    }

    @Override public Department getDepartmentById(Integer id) {
        return departmentMapper.getDepartmentById(id);
    }

    @Override public int updateByID(Department department) {
        return departmentMapper.updateByID(department);
    }

    @Override public int deleteById(Integer[] id) {
        return departmentMapper.deleteById(id);
    }
}
